package io.renren.modules.miniapp.controller;

import io.renren.common.utils.R;
import io.renren.modules.communityService.dto.MiniAppDbDailyHealthCardInfoDTO;
import io.renren.modules.communityService.dto.MiniAppDbDailyHealthCardSaveDTO;
import io.renren.modules.communityService.service.DbDailyHealthCardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 每日健康打卡
 *
 * @author chenweilong
 * @email 1433471850@qq.com
 * @date 2021-03-22 10:58:35
 */
@RestController
@RequestMapping("miniapp/dbdailyhealthcard")
@Api(value = "小程序每日健康打卡",tags = "小程序每日健康打卡")
public class MiniAppDbDailyHealthCardController {

    @Autowired
    private DbDailyHealthCardService dbDailyHealthCardService;

    /**
     * 每日健康打卡详情
     */
    @GetMapping("/info")
    @ApiOperation(value = "每日健康打卡详情",notes = "每日健康打卡详情")
    public R info(MiniAppDbDailyHealthCardInfoDTO dto){
        return R.data(dbDailyHealthCardService.info(dto));
    }

    /**
     * 每日健康打卡
     */
    @PostMapping("/save")
    @ApiOperation(value = "每日健康打卡",notes = "每日健康打卡")
    public R save(@RequestBody MiniAppDbDailyHealthCardSaveDTO dto){
		dbDailyHealthCardService.save(dto);
        return R.ok();
    }


}
